class MyThread extends Thread {
    @Override
    public void run() {
        System.out.println("继承Thread , 重写run");
    }
}
class MyRunnable implements Runnable{       // 创建MyRunnable类实现 Runnable接口
    @Override
    public void run() {                      //重写Runnable的 run 方法 ;
        System.out.println("My Runnable");
    }
}
public class Test2 {
    public static void main(String[] args) {
         Thread t1 = new Thread(()->{     // Lambda代替 Runnable ;
             System.out.println("Lambda表达式"); //run没有返回值,所以不需要return
         });
        t1.start();
    }
}
